package com.itheima.d04_thread_methods;

public class Test2 {

    public static void main(String[] args) throws InterruptedException {
        MyThread t1 = new MyThread("线程A");
        MyThread2 t2 = new MyThread2("线程B");


        //需求：让两个子线程执行完毕后，主线程再执行
        t2.start();
        t2.join(); //主线程停止等T2线程执行完毕


        t1.start(); //主线程启动T1线程
        t1.join();  //main主线程执行，等待t1线程执行完毕


        for (int i = 0; i < 10; i++) {
            System.out.println("main主线程：学习"  );
        }


    }
}
